package com.situ.javase.week3.Day2;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;

import com.situ.javase.day5.Student;

public class ExceptionDemo {
public static void main1(String[] args) {
	int i = 0;
	System.out.println(23/i);
}

public static void main2(String[] args) {
	com.situ.javase.week3.Day2.Student student = new com.situ.javase.week3.Day2.Student(1,"yuyang",350.2);
	student = null;
	//null.操作调用任何属性或者方法，就汇报空指针异常NullPointerException
	String name2 = student.getname();
}


public static void main3(String[] args) {
    int[] arr = {1, 2, 3};
    	//数组长度为3，下标到2，输出arr[3],就是数组下标越界
        System.out.println(arr[3]); 
}

public static void main4(String[] args) {
	String str = "12a";
	int i = Integer.parseInt(str);
	System.out.println(str);
}
public static HashMap m = new HashMap() {
	{
		put("a", "2");
	}
};

public static void main55(String[] args) {
	Integer isInt = (Integer) m.get("a");
	System.out.println(isInt);

	
	
}


public static void main(String[] args) {
	try {
		FileInputStream fileInputStream = new FileInputStream(new File(""));
	} catch (FileNotFoundException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
}